class URLParser:
    # @param path, a string
    # @return a string
    @classmethod
    def simplifyPath(cls, path):
        is_root = True
        if not path.startswith('/') and not path.startswith('../'):
            is_root = False
        path = path.split('/')
        curr = '/'
        for i in path:
            if i == '..':
                if curr != '/':
                    curr = '/'.join(curr.split('/')[:-1])
                    if curr == '': curr = '/'
            elif i != '.' and i != '':
                curr += '/' + i if curr != '/' else i
        print 'is_root',is_root
        if is_root:
            return curr
        else:
            return curr[1:]
        # return curr


print URLParser.simplifyPath('./test/../ee')
